#!/usr/bin/env python
# _*_ coding: utf-8 _*_
# @Time : 2020/8/13 0:45
# @Author : LZQ
# @Version：V 0.1
# @File : task.py
# @desc :
import os

from celery import Celery
from flask import current_app
from app.utils.fastdfs_utils import FDFS
import os

app = Celery('celery_tasks.tasks',broker='redis://192.168.158.129:6379/2')


@app.task
def upload_image(filePath):
    data = {}
    try:
        data =FDFS.upload_by_filename(filePath)

    except Exception as e:
        current_app.logger.error(e)
    return data
